<div id="subNav">
{$peopleNavList}
</div>

{if $errors}
<div class="errorMessage">
{foreach item=error from=$errors}
<span>{$error}</span><br />
{/foreach}
</div>
{/if}
	
{if $noResults}
	<p class="block">{$noResults}</p>
{else}
	{if $pager->links}
		<div class="pager">
		{$pager->links}
		</div>
	{/if}
{literal}
<script>
$(document).ready(function(){
    $(".newMessageButton").unbind().bind("click", function(){Peopletab.modal.initModal(
		{modal: false, 
		 width: 500, 
		 height: 450,
		 modalID: "newMessage",
		 ajax: $(this).attr("href")}
	); return false});
		
	$(".newMessageLink").unbind().bind("click", function(){Peopletab.modal.initModal(
		{modal: false, 
		 width: 500, 
		 height: 450,
		 modalID: $(this).attr("id"),
		 ajax: $(this).attr("href")}
	); return false});
});
</script>
{/literal}
	<table border="0" id="cpPeopleTable" class="cpTable" width="100%">
		<tr class="cpTableHeader">
			<td><a href ="{$sortLinks.userName}">User Name</a></td>
			<td><a href ="{$sortLinks.siteDomain}">Domain</a></td>
			<td><a href ="{$sortLinks.dateLastLogin}">Last Login</a></td>
			<td></td>
			<td></td>
		</tr>
	{foreach item=person from=$people}
		<tr valign="top" class="cpTableRow">
			<td><a href="http://{$person.siteDomain}/{$person.userName}">{$person.userName}</a></td>
			<td>{$person.siteDomain}</td>
			<td>{if $person.dateLastLogin}{$person.dateLastLogin|date_format:"%D %I:%M %p"}{else}unknown{/if}</td>
			<td>{if !$watchedBy}<a href="{$request->getHTTPPath()}?unwatch={$person.idSiteUser}">Unwatch</a>{/if}</td>
			<td><a href="/{$request->ownerName}/CP/Messages/new?to={$person.idSiteUser}" class="newMessageLink" id="to{$person.idSiteUser}">Message</a></td>
		</tr>
	{/foreach}
	</table>
	{if $pager->links}
		<div class="pager">
		{$pager->links}
		</div>
	{/if}
{/if}